package cn.jja8.config.tool.work.basic;

import java.lang.reflect.Field;

public class FieldHandDouble implements BasicFieldHand {

    @Override
    public Class Type() {
        return double.class;
    }

    /**
     * 从配置里读
     */
    @Override
    public void setValue(Field field, Object obj, Object con) throws Throwable {
        field.setAccessible(true);
        field.setDouble(obj, Double.parseDouble(con.toString()));
    }

    /**
     * 写到配置里
     */
    @Override
    public Object getValue(Field field, Object obj) throws Throwable {
        field.setAccessible(true);
        return field.getDouble(obj);
    }
}
